<?php

namespace App\Console;

use App\Console\Commands\Test1;
use Illuminate\Console\Scheduling\Schedule;
use Laravel\Lumen\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        //
        'App\Console\Commands\Test1',
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        //
        $schedule->command(Test1::class)->runInBackground()
            ->withoutOverlapping()->appendOutputTo("./zyblog_test1.log");

        $schedule->call(function(){
            echo "Cron Three Minutes：", date('Y-m-d H:i:s');
        })->cron("* * * * *")->appendOutputTo("./zyblog_test1.log");
    }
}
